<template>
  <van-tabbar route :border="false" active-color="#7d7e80" placeholder>
    <van-tabbar-item v-for="(item,index) in tabbar" :key="index" :to="item.path">
      <span>{{item.title}}</span>
      <template #icon="props">
        <img :src="props.active ? item.imgs[1] : item.imgs[0]">
      </template>
    </van-tabbar-item>
  </van-tabbar>
</template>

<script>
export default {
  data() {
    return {
      tabbar: [{
        path: '/',
        title: '首页',
        imgs: [require('@/assets/images/home.png'), require('@/assets/images/home_active.png')],
      },
      {
        path: '/study',
        title: '在学',
        imgs: [require('@/assets/images/study.png'), require('@/assets/images/study_active.png')],
      },
      {
        path: '/member',
        title: '我的',
        imgs: [require('@/assets/images/member.png'), require('@/assets/images/member_active.png')],
      }],
    };
  },
};
</script>
